package per.sunmes.cl;

import per.sunmes.cl.g.CardLandGameMain;
import per.sunmes.cl.g.sys.G;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.assets.loaders.FileHandleResolver;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.badlogic.gdx.files.FileHandle;

public class CardLandMainRun {

	public static void main(String[] args) {
		LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
		config.width = 1280;
		config.height = 720;
		config.vSyncEnabled = false;
		config.backgroundFPS = 0;
		config.foregroundFPS = 60;

		G.width = 1280;
		G.height = 720;
		// ///
		G.application = new LwjglApplication(new CardLandGameMain(), config);
		// G.application = new CustomLwjglAppRun(new CardLandGameMain(),
		// config);
		desktopInit();
	}

	private static void desktopInit() {
		G.fileResolver = new FileHandleResolver() {
			String baseDir = Gdx.files.getLocalStoragePath() + "/resource/";

			@Override
			public FileHandle resolve(String fileName) {

				return Gdx.files.absolute(baseDir + fileName);
			}
		};
		G.asset = new AssetManager(G.fileResolver);
	}
}
